﻿using J.Status.Application.Command.BookingCommand;
using J.StatusModel.Dto;
using MediatR;
using StatusService;

namespace J.Status.Application.Handler.BookingHandler
{
    public class StayDtoFindHandler : IRequestHandler<StayDtoFindCommand, StayDto>
    {
        private readonly IBookingService bookingService;

        public StayDtoFindHandler(IBookingService bookingService)
        {
            this.bookingService = bookingService;
        }

        public async Task<StayDto> Handle(StayDtoFindCommand request, CancellationToken cancellationToken)
        {
            return await bookingService.GetStayDto(request.roomNum);
        }
    }
}
